//
//  APIHeartRateTests.swift
//  APIHeartRateTests
//
//  Created by fortresspower on 2023/11/26.
//

import XCTest
import APIHeartRate

final class APIHeartRateTests: XCTestCase {

    
    override func setUpWithError() throws {
        // Put setup code here. This method is called before the invocation of each test method in the class.
        
    }

    override func tearDownWithError() throws {
        // Put teardown code here. This method is called after the invocation of each test method in the class.
    }
    
    func testVSersion() throws{
        XCTAssert(APIHeartRateManager.instance.checkIfLeagacyVersion(version: "V2.9.0") == true)
        XCTAssert(APIHeartRateManager.instance.checkIfLeagacyVersion(version: "V2.9.1") == true)
        XCTAssert(APIHeartRateManager.instance.checkIfLeagacyVersion(version: "V2.9.2") == true)
        XCTAssert(APIHeartRateManager.instance.checkIfLeagacyVersion(version: "") == true)
    }
    func testTSersion() throws{
        XCTAssert(APIHeartRateManager.instance.checkIfLeagacyVersion(version: "T2.9.0") == true)
        XCTAssert(APIHeartRateManager.instance.checkIfLeagacyVersion(version: "T2.9.2") == false)
        XCTAssert(APIHeartRateManager.instance.checkIfLeagacyVersion(version: "T2.9.3") == false)
    }
    func testGSersion() throws{
        XCTAssert(APIHeartRateManager.instance.checkIfLeagacyVersion(version: "G2.9.0") == true)
        XCTAssert(APIHeartRateManager.instance.checkIfLeagacyVersion(version: "G2.9.1") == false)
        XCTAssert(APIHeartRateManager.instance.checkIfLeagacyVersion(version: "G2.9.2") == false)
        
        XCTAssert(APIHeartRateManager.instance.checkIfLeagacyVersion(version: "2.9.1") == false)
        XCTAssert(APIHeartRateManager.instance.checkIfLeagacyVersion(version: "G1.1.0") == true)
        XCTAssert(APIHeartRateManager.instance.checkIfLeagacyVersion(version: "G3.1.0") == false)
        XCTAssert(APIHeartRateManager.instance.checkIfLeagacyVersion(version: "3.1.0.G") == false)
        XCTAssert(APIHeartRateManager.instance.checkIfLeagacyVersion(version: "3.1.0.") == false)
        XCTAssert(APIHeartRateManager.instance.checkIfLeagacyVersion(version: "2.1.0.G") == true)
    }
    func testPerformanceExample() throws {
        // This is an example of a performance test case.
        measure {
            // Put the code you want to measure the time of here.
        }
    }

}
